home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / crayola / common / crayola.c < prev    next >
C/C++ Source or Header  |  1993-01-12  |  3KB  |  108 lines

  1. #include "geom.h"
  2. #include "color.h"
  3. #include "crayolaP.h"
  4.  
  5. ColorA crayDefColor = {CRAY_DEFR, CRAY_DEFG, CRAY_DEFB, CRAY_DEFA};
  6.  
  7. static char methods[][CRAYOLA_MAXNAME] = 
  8. {
  9.   CRAYOLA_METHNAMES
  10. };
  11. int sel[CRAYOLA_MAXMETH];
  12.  
  13. void crayolaInit() {
  14.   int i;
  15.  
  16.   for (i = 0; i < CRAYOLA_MAXMETH; i++) 
  17.     sel[i] = GeomNewMethod(methods[i], crayFalse);
  18.  
  19.   cray_bezier_init();
  20.   cray_inst_init();
  21.   cray_list_init();
  22.   cray_mesh_init();
  23.   cray_polylist_init();
  24.   cray_quad_init();
  25.   cray_vect_init();
  26.  
  27. }
  28.  
  29. void crayInitSpec(craySpecFunc *specfunc, int n_func, GeomClass *class) {
  30.   int i;
  31.   for (i = 0; i < n_func; i++) 
  32.     GeomSpecifyMethod(GeomMethodSel(specfunc[i].name), class,
  33.                     specfunc[i].func);
  34. }
  35.  
  36. int crayHasColor(Geom *geom, int *gpath) {
  37.   return (int)GeomCall(sel[0], geom, gpath);
  38. }
  39.  
  40. int crayHasVColor(Geom *geom, int *gpath) {
  41.   return (int)GeomCall(sel[1], geom, gpath);
  42. }
  43.  
  44. int crayHasFColor(Geom *geom, int *gpath) {
  45.   return (int)GeomCall(sel[2], geom, gpath);
  46. }
  47.  
  48. int crayCanUseVColor(Geom *geom, int *gpath) {
  49.   return (int)GeomCall(sel[3], geom, gpath);
  50. }
  51.  
  52. int crayCanUseFColor(Geom *geom, int *gpath) {
  53.   return (int)GeomCall(sel[4], geom, gpath);
  54. }
  55.  
  56. int crayUseVColor(Geom *geom, ColorA *color, int *gpath) {
  57.   return (int)GeomCall(sel[5], geom, color, gpath);
  58. }
  59.  
  60. int crayUseFColor(Geom *geom, ColorA *color, int *gpath) {
  61.   return (int)GeomCall(sel[6], geom, color, gpath);
  62. }
  63.  
  64. int crayEliminateColor(Geom *geom, int *gpath) {
  65.   return (int)GeomCall(sel[7], geom, gpath);
  66. }
  67.  
  68. int craySetColorAll(Geom *geom, ColorA *color, int *gpath) {
  69.   return (int)GeomCall(sel[8], geom, color, gpath);
  70. }
  71.  
  72. int craySetColorAt(Geom *geom, ColorA *color, int vindex, int findex, 
  73.            int *edge, int *gpath, HPoint3 *pt) {
  74.   return (int)GeomCall(sel[9], geom, color, vindex, findex, edge, gpath, 
  75.                pt);
  76. }
  77.  
  78. int craySetColorAtV(Geom *geom, ColorA *color, int index, int *gpath,
  79.             HPoint3 *pt) {
  80.   return (int)GeomCall(sel[10], geom, color, index, gpath, pt);
  81. }
  82.  
  83. int craySetColorAtF(Geom *geom, ColorA *color, int index, int *gpath) {
  84.   return (int)GeomCall(sel[11], geom, color, index, gpath);
  85. }
  86.  
  87. int crayGetColorAt(Geom *geom, ColorA *color, int vindex, int findex,
  88.            int *edge, int *gpath, HPoint3 *pt) {
  89.   return (int)GeomCall(sel[12], geom, color, vindex, findex, edge, gpath, pt);
  90. }
  91.  
  92. int crayGetColorAtV(Geom *geom, ColorA *color, int index, int *gpath,
  93.             HPoint3 *pt) {
  94.   return (int)GeomCall(sel[13], geom, color, index, gpath, pt);
  95. }
  96.  
  97. int crayGetColorAtF(Geom *geom, ColorA *color, int index, int *gpath) {
  98.   return (int)GeomCall(sel[14], geom, color, index, gpath);
  99. }
  100.  
  101. void *crayTrue(int sel, Geom *geom, va_list args) {
  102.   return (void *)1;
  103. }
  104.  
  105. void *crayFalse(int sel, Geom *geom, va_list args) {
  106.   return (void *)0;
  107. }
  108.